package com.cow.config;


import com.alipay.api.request.AlipayTradePagePayRequest;

import com.cow.util.general.PropertiesUtil;
import lombok.Data;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 *
 */
@Data
@Component
public class AlipayConfig {
    /**
     * 沙箱appId
     */
    public static final String APPID = "2021000149627204";

    /**
     * 请求网关  固定
     */
    public static final String URL = "https://openapi-sandbox.dl.alipaydev.com/gateway.do";

    /**
     * 编码
     */
    public static final String CHARSET = "UTF-8";

    /**
     * 返回格式
     */
    public static final String FORMAT = "json";

    /**
     * RSA2
     */
    public static final String SIGNTYPE = "RSA2";

    /**
     * 异步通知地址
     */
    public static final String NOTIFY_URL = "http://" + PropertiesUtil.getDomain() + "/alipay/notify";

    /**
     * 同步地址
     */
    public static final String RETURN_URL = "http://" + PropertiesUtil.getDomain() + "/alipay" +
            "/success";

    /**
     * 应用私钥 pkcs8格式
     */
    public static final String RSA_PRIVATE_KEY =
           "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCNVLwk5v+GEsxtsKFGJ4krkFVhma3WL1+cvVdZFzpls+ep3lz0afEMJ3jrsngZt+pC4sNed5EfZNZe3he4OJd7x7rh+r3QN1DOETMpKSBO56UR/DlxznYTuT6Fa4OMpyxIVzfyb2A6QFHevN/Cjpb6P6yIr1MefLdkIhK6LsP5QgLZH2uvTcx+c1wnLIub6VA0V+ddbWvLbTrc+zgS9G/AhcLm06aPG2MxNjV1LngDNTM3qWemSQ/9we+DwKSJgzWzQx3Bz4xz75s5xtnRXUOjY6x3GjDzKzmZ0H0LnsGSZjtpZck/dPzbu8LAMkVG4tr2Sq14XRFkARboLaOy2JWNAgMBAAECggEAe1vRmNgzgmAYJUn9ipFprieeDsGntQLGjrXJbw7SPwEnnOJk+kUaS8SMTBYLtE8OX3E0m9j7R46pekaaJ4bl2fm8ihBk6z/M/QCQSkYGWDjioO8paMeP0qlnA+eS/ArSoRXX1HkYYd/QVf0/xb7V0voO64M0prCvFeyT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宝公钥z'z'z
     */
    public static final String ALIPAY_PUBLIC_KEY =
           "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkcLfOf3FQ4r0SxWpRGi/nlEcALcHUYT06zL0IUW7ZYvlnUU6ubmHvTgnHgdg62eJ4d/BhIJXUewpGy/gGG42drTycbrSOCaXbcvB+ksoXsOGwad1GcbJgtAqPIiRZNAqbXpTLOOxxafJdqKH+penHXgtRbsaFIWuTrFXk0FKJ4r2UWrjvs4/9l2P03GlfnFRa4pKEnecVQfQubCEJWNAapY8fGlYUuf/75A364udP166G5IpfbKotRCbnzUOr0Vo7yaHghfmP7+3SVrlrrJCgSQTWzl3JTrxiI4MRGOLvXa3pJZPkp95DcL7N9nHUJVr+G3VZYvwq6wqLnESaIs3awIDAQAB";
    private AlipayConfig() {
    }


    //多列模式的 aliPayRequest
    @Bean
    public AlipayTradePagePayRequest alipayTradePagePayRequest(){
        AlipayTradePagePayRequest alipayRequest = new AlipayTradePagePayRequest();
        return alipayRequest;
    }
}
